﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MethodWorx.CMS.Administration;
using System.ComponentModel.DataAnnotations;

namespace MethodWorx.CMS.UI.Models
{
    public class ApplicationSettingsModel
    {
     

        [Required(ErrorMessage="Please select an application type")]
        public Guid? ApplicationTypeId { get; set; }
        [Required(ErrorMessage="Please enter a base Uri for the website")]
        public string BaseUri { get; set; }
       
        public bool FromContent { get; set; }

        public SelectList GetApplicationTypeSelectList()
        {
            return new SelectList(ApplicationTypeFactory.Instance.GetApplicationTypes(), "ApplicationTypeId", "Name", this.ApplicationTypeId ?? Guid.Empty);
        }

        public IEnumerable<ApplicationType> ApplicationTypes
        {
            get
            {
                return ApplicationTypeFactory.Instance.GetApplicationTypes();
            }
        }
    }
}
